package edu.nwmissouri.galaxygames;

import android.app.ActionBar;
import android.app.ActionBar.Tab;
import android.app.Fragment;
import android.app.FragmentTransaction;

public class Navigation implements ActionBar.TabListener
{
    
    //Fragment that this particular listener is controlling
    Fragment frag;
    
    //Easy access to parent.
    MainActivity activity;

    public Navigation(Fragment frag, MainActivity activity)
    {
	this.frag = frag;
	this.activity = activity;
    }
    
    @Override
    public void onTabReselected(Tab arg0, FragmentTransaction ft)
    {
    	
    }

    //Replace current tab on screen with the fragment this listener is handling.
    @Override
    public void onTabSelected(Tab tab, FragmentTransaction ft)
    {
	ft.replace(R.id.container, frag);
    }

    @Override
    public void onTabUnselected(Tab arg0, FragmentTransaction arg1)
    {
	// TODO Auto-generated method stub
	
    }

}

